<?php

namespace App\Http\Controllers\Admin;

use App\Models\HomepageRecommendModule;
use Illuminate\Http\Request;

class HomepageRecommendModuleController extends BaseController
{
    public function __construct()
    {
        $this->middleware('check_admin_login');
    }

    public function index()
    {
        $list = HomepageRecommendModule::query()->select(['id','title'])->where('deleted',0)->get();

        $items = [];
        if(!empty($list))
        {
            foreach ($list as $v)
            {
                $items[] = [
                    'id'    => $v['id'],
                    'title' => $v['title'],
                ];
            }
        }
        return $this->ok($items);
    }
}
